Unable to attach or mount volumes: unmounted volumes=[nfs

您所在的位置:网站首页 mount xxxx wrong fs type bad option Unable to attach or mount volumes: unmounted volumes=[nfs

Unable to attach or mount volumes: unmounted volumes=[nfs

2023-03-10 12:04| 来源: 网络整理| 查看: 265

一、环境

在k8s 集群中创建了一个存储类,但是发现这pod 一直处于ContainerCreating 中

[root@master xlj]# kubectl get pod -A NAMESPACE NAME READY STATUS RESTARTS AGE default nfs-client-provisioner-7c9675bd5d-sdk26 0/1 ContainerCreating 0 81m kube-system calico-kube-controllers-577f77cb5c-6cj5b 1/1 Running 0 96m kube-system calico-node-8rp2m 1/1 Running 0 96m kube-system calico-node-j6rg5 1/1 Running 0 93m kube-system calico-node-xvhhm 1/1 Running 0 93m kube-system coredns-54d67798b7-bjjsh 1/1 Running 0 103m kube-system coredns-54d67798b7-zvg28 1/1 Running 0 103m kube-system etcd-master 1/1 Running 0 103m kube-system kube-apiserver-master 1/1 Running 0 103m kube-system kube-controller-manager-master 1/1 Running 0 103m kube-system kube-proxy-48bg2 1/1 Running 0 93m kube-system kube-proxy-8v59z 1/1 Running 0 103m kube-system kube-proxy-hhhrj 1/1 Running 0 93m kube-system kube-scheduler-master 1/1 Running 0 103m 一、报错

安装nfs-provide-client的时候pod 一直不能启动,然后报错:

[root@master xlj]# kubectl describe pod nfs-client-provisioner-7c9675bd5d-sdk26 Events: Type Reason Age From Message ---- ------ ---- ---- ------- Warning FailedMount 21m (x5 over 57m) kubelet Unable to attach or mount volumes: unmounted volumes=[nfs-client-root], unattached volumes=[nfs-client-provisioner-token-w2dx8 nfs-client-root]: timed out waiting for the condition Warning FailedMount 5m14s (x20 over 64m) kubelet Unable to attach or mount volumes: unmounted volumes=[nfs-client-root], unattached volumes=[nfs-client-root nfs-client-provisioner-token-w2dx8]: timed out waiting for the condition Warning FailedMount 62s (x40 over 66m) kubelet MountVolume.SetUp failed for volume "nfs-client-root" : mount failed: exit status 32 Mounting command: mount Mounting arguments: -t nfs 10.0.0.87:/nfs/data /var/lib/kubelet/pods/90301000-5614-4f32-bc0b-ea1e64434d96/volumes/kubernetes.io~nfs/nfs-client-root Output: mount: wrong fs type, bad option, bad superblock on 10.0.0.87:/nfs/data, missing codepage or helper program, or other error (for several filesystems (e.g. nfs, cifs) you might need a /sbin/mount. helper program) In some cases useful info is found in syslog - try dmesg | tail or so. 三、解决 1.测试nfs 是否可用

先找了个客户端挂载,试了下,发现是可以写入到nfs-server的挂载路径的 但是安装的nfs-provider却启动不来

#找了一个客户端测试,发现是可以挂载的,但是在k8s 集群中却老是显示不能 [root@centos7 ~]# showmount -e 10.0.0.87 Export list for 10.0.0.87: /nfs/data * showmount -e 10.0.0.87 mkdir /nfs/data mount -t nfs 10.0.0.87:/nfs/data /nfs/data 2.原因

要挂载NFS客户端--即node 节点,没有安装nfs-util, *也就是说被挂载的节点必须安装nfs 的客户端*,否则不适配

3.解决

在node 节点上安装nfs客户端,可以自己在yaml 文件中使用标签绑定节点,就可以在指定的节点上创建这个nfs 的pod ,即就不用在其他节点上也安装上nfs 客户端了

yum -y install nfs-utils


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3